#include <iostream>
#include <fstream>
#include <time.h>
using namespace std;
int main()
{    long n,m,d;
   // ofstream cout("10.a");
   // ofstream fout("10.");

    //srand(time(NULL));
    //a=2000000;//+rand()%100000;
    cin>>n>>m;
   // fout << n<< endl<<m;

    d=max(n,m)*2 + (min(n,m)-2)*2;
    cout << d;
}
